/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.business.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseBusiness;
import me.zhengjie.domain.LocalStorage;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
* @website https://el-admin.vip
* @description /
* @author xiahongbo
* @date 2022-08-03
**/
@Entity
@Data
@Table(name="BIS_ORDER_MX")
public class OrderMx extends BaseBusiness implements Serializable {
    @Id
    @GenericGenerator(name = "hibernate-uuid", strategy = "uuid")
    @GeneratedValue(generator = "hibernate-uuid")
    @Column(name = "BIS_ORDER_MX_ID")
    @ApiModelProperty(value = "订单明细ID")
    private String bisOrderMxId;

    @Column(name = "BIS_ORDER_ID")
    @ApiModelProperty(value = "订单ID")
    private String bisOrderId;

    @Column(name = "BIS_ORDER_ZHID")
    @ApiModelProperty(value = "照护ID")
    private Long bisOrderZhid;

    @Column(name = "BIS_ORDER_FAFFXID")
    @ApiModelProperty(value = "方案服务项ID")
    private String bisOrderFaffxid;

    @Column(name = "BIS_ORDER_FWBM")
    @ApiModelProperty(value = "服务编码")
    private String bisOrderFwbm;

    @Column(name = "BIS_ORDER_FWMC")
    @ApiModelProperty(value = "服务名称")
    private String bisOrderFwmc;

    @Column(name = "BIS_ORDER_SC")
    @ApiModelProperty(value = "服务时长")
    private String bisOrderSc;

    @Column(name = "BIS_ORDER_FWLX")
    @ApiModelProperty(value = "服务类型（91复核 94生活护理 95  医疗护理）")
    private String bisOrderFwlx;

    @Column(name = "BIS_ORDER_JSLX")
    @ApiModelProperty(value = "结算类型（1甲类 3丙类）")
    private String bisOrderJslx;

    @Column(name = "BIS_ORDER_SL")
    @ApiModelProperty(value = "数量")
    private String bisOrderSl;

    @Column(name = "BIS_ORDER_DJ")
    @ApiModelProperty(value = "单价")
    private Long bisOrderDj;

    @Column(name = "BIS_ORDER_ZJM")
    @ApiModelProperty(value = "助记码")
    private String bisOrderZjm;

    @Column(name = "BIS_ORDER_ZT")
    @ApiModelProperty(value = "状态")
    private String bisOrderZt;


    @OneToMany
    @JoinColumn(name="YWID", referencedColumnName="BIS_ORDER_MX_ID",insertable = false,updatable = false)
    private List<LocalStorage> localStorageList;


    public void copy(OrderMx source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
    @Override
    public int hashCode() {
        return Objects.hash(bisOrderMxId, bisOrderId, bisOrderZhid);
    }
}